class Solution(object):
    def complexNumberMultiply(self, num1, num2):
        """
        :type num1: str
        :type num2: str
        :rtype: str
        """
        s1 = num1.split('+')
        r1 = int(s1[0])
        u1 = int(s1[1][:-1])
        s2 = num2.split('+')
        r2 = int(s2[0])
        u2 = int(s2[1][:-1])
        r = r1 * r2 - u1 * u2
        u = r1 * u2 + r2 * u1
        return str(r) + '+' + str(u) + 'i'
